package com.cmower.baeldung.random;

import java.util.Random;

public class GenerateRandomInteger {
    public static void main(String[] args) {
        int leftLimit = 2;
        int rightLimit = 11;

        Random random = new Random();
        int range = rightLimit - leftLimit;

        Runnable r = () -> {
            float f = random.nextFloat() * range;
            System.out.print(f + " ");
            int generatedInteger = leftLimit + (int)(f);
            System.out.println(generatedInteger);
        };
       for (int i = 1; i < 10; i++) {
           new Thread(r).start();
       }
    }
}
